package Common.Entities;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * This abstract class holds common data for any entity represents a human actor in the system
 * @author ori ziv
 *
 */
public abstract class Person implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6761693068884444098L;
	
	private String ID;
	private String name;
	private Date birthday;
	private String phone;
	
	public Person () {
		ID = null;
		name = null;
		birthday = null;
		phone = null;
	}
	
	/**
	 * @param iD	person unique identification (Primary key)
	 * @param name	person name
	 * @param birthday	person birthday
	 * @param phone	person phone number
	 */
	public Person(String iD, String name, Date birthday, String phone) {
		ID = iD;
		this.name = name;
		this.birthday = birthday;
		this.phone = phone;
	}
	public String getID() {
		return ID;
	}
	public void setID(String iD) {
		ID = iD;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Date getBithday() {
		return birthday;
	}
	public String getStringBithday() {
		DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
		String bDate = df.format(birthday);
		return bDate;
	}
	public void setBithday(Date bithday) {
		this.birthday = bithday;
	}
	public String getPhone() {
		return phone;
	}
	public void setPhone(String phone) {
		this.phone = phone;
	}
	

}
